# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=metacoretex
pkgver=0.8.0
pkgrel=4
pkgdesc='An entirely JAVA vulnerability scanning framework for databases.'
url='http://metacoretex.sourceforge.net/'
groups=('blackarch' 'blackarch-database')
arch=('any')
license=('custom')
depends=('java-environment')
source=("http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz")
sha512sums=('c5b4a28f0c2a6e0ed3bc2929a5368d2fc42cef88efc7af43b1fc11945ec16ae5256a5d12baa85280c3228b948be94b14bccab4b238dcabccc212bb07f4b3dc76')

package() {
  cd "$pkgname-$pkgver"

  install -dm 755 "$pkgdir/usr/bin/"
  install -dm 755 "$pkgdir/usr/share/$pkgname/"

  install -Dm 755 mctx.sh "$pkgdir/usr/share/$pkgname/mctx.sh"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README TODO
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  cp -a docs/* "$pkgdir/usr/share/doc/$pkgname/"
  cp -a contrib schema conf dist probes "$pkgdir/usr/share/$pkgname"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname/
exec ./mctx.sh "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

